﻿<Window x:Class="SQLToolbox.View.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:uc="clr-namespace:SQLToolbox.View.UserControls"
         Title="SQLToolbox.NET" Height="502" Width="801" WindowState="Maximized"
        Icon="Resources\Main.ico"
        Loaded="Window_Loaded" >

    <Window.Resources>
        <LinearGradientBrush x:Key="SelectedTabBrush" StartPoint="0,0" EndPoint="0,1">
            <GradientBrush.GradientStops>
                <GradientStopCollection>
                    <GradientStop Color="#FFFCFBFB" Offset="0.0"/>
                    <GradientStop Color="#FFD4D0C8" Offset="0.5"/>
                    <GradientStop Color="#FFD4D0C8" Offset="1.0"/>
                </GradientStopCollection>
            </GradientBrush.GradientStops>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="TabBrush" Color="#FFD4D0C8" />
        <SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />
        <SolidColorBrush x:Key="WindowBackgroundBrush" Color="#FFF" />
        <SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" />
        <SolidColorBrush x:Key="DisabledBorderBrush" Color="#AAA" />
        <SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />

        <Style  TargetType="{x:Type TabControl}">
            <Setter Property="OverridesDefaultStyle" Value="True" />
            <Setter Property="SnapsToDevicePixels" Value="True" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TabControl}">
                        <Grid KeyboardNavigation.TabNavigation="Local">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <TabPanel 
                                    Name="HeaderPanel"
                                    Grid.Row="0"
                                    Panel.ZIndex="1" 
                                    Margin="4,0,4,-1" 
                                    IsItemsHost="True"
                                    KeyboardNavigation.TabIndex="1"
                                    Background="Transparent" />
                            <Border 
                                    Margin="4,0,4,4" 
                                    Name="Border" 
                                    Grid.Row="1" 
                                    Background="Transparent" 
                                    BorderBrush="{StaticResource SolidBorderBrush}" 
                                    BorderThickness="1" 
                                    CornerRadius="0,0,10,10" 
                                    KeyboardNavigation.TabNavigation="Local"
                                    KeyboardNavigation.DirectionalNavigation="Contained"
                                    KeyboardNavigation.TabIndex="2" >
                                <ContentPresenter DockPanel.Dock="Top"
                                      Name="PART_SelectedContentHost"
                                      Margin="5"
                                      ContentSource="SelectedContent"/>
                            </Border>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
                                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Window.Background>
        <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
            <GradientStop Color="#FFD4D0C8" Offset="0.0" />
            <GradientStop Color="#FFF5F5F5" Offset="1.0" />
        </LinearGradientBrush>
    </Window.Background>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Name="Row0" Height="Auto" />
            <RowDefinition Name="Row1" Height="Auto" />
            <RowDefinition Name="Row2" />
        </Grid.RowDefinitions>
        <Menu Height="22" Grid.Row="0" Name="menu1" VerticalAlignment="Top" Background="Transparent">
            <MenuItem Header="_File">
                <Separator />
                <MenuItem Header="E_xit"
                InputGestureText="Alt-F4"
                Click="fileExit"
                ToolTip="Click here to exit"
                Name="miFileExit"/>
            </MenuItem>
            <MenuItem Header="_Tools">
                <MenuItem Header="Compare" Click="Compare_Click"/>
            </MenuItem>
            <MenuItem Header="_Window">
                <MenuItem Header="_Close" Click="CloseTabMenuItem_Click"/>
                <MenuItem Header="Close _All" Click="CloseAllTabs_Click"/>
            </MenuItem>
        </Menu>
        <ToolBarTray Grid.Row="1" Name="toolBarTray1" HorizontalAlignment="Stretch" Background="Transparent" MinHeight="40">
            <ToolBarTray.ContextMenu>
                <ContextMenu Name="cmToolbars">
                    <MenuItem Name="tbtcmi_tools" Header="Tools" IsCheckable="True" IsChecked="True" Checked="tbtcmi_CheckedChanged" Unchecked="tbtcmi_CheckedChanged"/>
                    <MenuItem Name="tbtcmi_comparison" Header="Comparison" IsCheckable="True" Checked="tbtcmi_CheckedChanged" Unchecked="tbtcmi_CheckedChanged"/>
                </ContextMenu>
            </ToolBarTray.ContextMenu>
            <ToolBar Name="tbTools" Band="1" BandIndex="1" Height="40" >
                <Button Click="Compare_Click" ToolTip="Compare">
                    <Image Source="Resources\CompareNew.ico"/>
                </Button>
            </ToolBar>
            <ToolBar Band="1" BandIndex="2" Height="40" Name="tbComparerActions" Visibility="Collapsed">
                <Button ToolTip="Match Right to Left" Click="MatchRTL_Click">
                    <Image Source="Resources\ToRight.ico"/>
                </Button>
                <Button ToolTip="Match Left to Right" Click="MatchLTR_Click">
                    <Image Source="Resources\ToLeft.ico"/>
                </Button>
                <Separator/>
                <Button ToolTip="Swap" Click="Swap_Click">
                    <Image Source="Resources\Swap.ico"/>
                </Button>
                <Button ToolTip="Refresh" Click="Refresh_Click">
                    <Image Source="Resources\Refresh.ico"/>
                </Button>
            </ToolBar>
        </ToolBarTray>
        <DockPanel Name="dockPanel1" Grid.Row="2">
            <TabControl Name="tcMain" DockPanel.Dock="Top" SelectionChanged="tcMain_SelectionChanged">
             </TabControl>
        </DockPanel>
    </Grid>
</Window>
